﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ControlChuyenDoanhSoGiuaCacBA.ascx.cs" Inherits="WebUserControl_ControlChuyenDoanhSoGiuaCacBA" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register src="uscTitleForm.ascx" tagname="uscTitleForm" tagprefix="uc1" %>
<%@ Register src="uscMsgBox.ascx" tagname="uscMsgBox" tagprefix="uc1" %>
<link rel="stylesheet" href='<%=ResolveUrl("~/LayoutCss/datePicker.css")%>' type="text/css" />

<script type="text/javascript">
     function pageLoad() {
     $(function()
     {
	    $("#<%= txtNgayHoaDon.ClientID %>").datePicker(
		{
			clickInput:true,
			startDate: '01/01/1970'
		}
	);
});
    
       $("#<%= btCheck.ClientID %>").click(function() {
        if($("#<%= txtMaBA.ClientID %>").val().length>0 && $("#<%= txtSoHoaDon.ClientID %>").val().length>0 && $("#<%= txtMaBA2.ClientID %>").val().length>0)
          { 
        $.blockUI({
             message: '<h1>Xin vui lòng chờ xử lý</h1>', 
            css: { 
            border: 'none', 
            padding: '15px', 
            backgroundColor: '#f00', 
            opacity: .5, 
            color: '#fff' 
             } }); 
        }
        });
        
        $("#<%= btChonLai.ClientID %>").click(function() { 
        $.blockUI({
             message: '<h1>Xin vui lòng chờ xử lý</h1>', 
            css: { 
            border: 'none', 
            padding: '15px', 
            backgroundColor: '#f00', 
            opacity: .5, 
            color: '#fff' 
        } }); 
        }); 
         $("#<%= btChuyenDoanhSo.ClientID %>").click(function() {
          if($("#<%= txtMaBA.ClientID %>").val().length>0 && $("#<%= txtSoHoaDon.ClientID %>").val().length>0 && $("#<%= txtMaBA2.ClientID %>").val().length>0)
          {  
        $.blockUI({
             message: '<h1>Xin vui lòng chờ xử lý</h1>', 
            css: { 
            border: 'none', 
            padding: '15px', 
            backgroundColor: '#f00', 
            opacity: .5, 
            color: '#fff' 
        } });
        } 
        }); 
           $("#<%= btXoaManHinh.ClientID %>").click(function() { 
        $.blockUI({
             message: '<h1>Xin vui lòng chờ xử lý</h1>', 
            css: { 
            border: 'none', 
            padding: '15px', 
            backgroundColor: '#f00', 
            opacity: .5, 
            color: '#fff' 
        } }); 
        }); 
        Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
                function EndRequestHandler(sender, args) {
                        $.unblockUI();
                }
        }  
   
</script>  
<style type="text/css">
.bt
{
	margin-left:10px;
}
   
</style>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<uc1:uscMsgBox ID="uscMsgBox1"  runat="server" />
<uc1:uscTitleForm ID="uscTitleForm1" runat="server" Messeage="Chuyển doanh số giữa các BA" />
<table>
  <tr>
    <td>TTPP</td>
    <td>
      <asp:DropDownList  width="200px" ID="DropTTPP"  runat="server">
    </asp:DropDownList>
    </td>
    <td></td>
    <td></td>
  </tr>
  <tr>
    <td>Ngày hóa đơn</td>
    <td><asp:TextBox ID="txtNgayHoaDon" width="100px"  runat="server"></asp:TextBox></td>
       <td></td>
    <td></td>                          
  </tr>
  <tr>
   <td>Mã BA</td>
                               
    <td><asp:TextBox ID="txtMaBA" width="100px"  runat="server"></asp:TextBox>
     <asp:RequiredFieldValidator ControlToValidate="txtMaBA" Display="None"  ID="RequiredFieldValidator1" runat="server" ErrorMessage="Phải nhập mã BA">
                                </asp:RequiredFieldValidator>
                                 <cc1:ValidatorCalloutExtender  TargetControlID="RequiredFieldValidator1" ID="ValidatorCalloutExtender1" runat="server">
                                </cc1:ValidatorCalloutExtender>
    </td>
    <td>Họ tên</td>
    <td><asp:TextBox ID="txtHoTenBA" width="200px" ReadOnly="true"  BackColor="#ffff66"  runat="server"></asp:TextBox></td>
  </tr>
  <tr>
   <td>Số hóa đơn</td>
    <td><asp:TextBox ID="txtSoHoaDon" width="100px"  runat="server"></asp:TextBox>
     <asp:RequiredFieldValidator ControlToValidate="txtSoHoaDon" Display="None"  ID="RequiredFieldValidator2" runat="server" ErrorMessage="Phải nhập số hóa đơn">
                                </asp:RequiredFieldValidator>
                                 <cc1:ValidatorCalloutExtender  TargetControlID="RequiredFieldValidator2" ID="ValidatorCalloutExtender2" runat="server">
                                </cc1:ValidatorCalloutExtender>
    </td>
    <td>Tiền hóa đơn</td>
    <td><asp:TextBox ID="txtTienHD" width="200px" ReadOnly="true" BackColor="#ffff66"  runat="server"></asp:TextBox></td>
  </tr>
  <tr>
  <td colspan="4" style="color:Blue">
  Chuyển cho BA
  </td>
  </tr>
  <tr>
   <td>Mã BA</td>
    <td><asp:TextBox ID="txtMaBA2" width="100px"  runat="server"></asp:TextBox>
      <asp:RequiredFieldValidator ControlToValidate="txtMaBA2" Display="None"  ID="RequiredFieldValidator3" runat="server" ErrorMessage="Phải nhập mã BA muốn chuyển">
                                </asp:RequiredFieldValidator>
                                 <cc1:ValidatorCalloutExtender TargetControlID="RequiredFieldValidator3" ID="ValidatorCalloutExtender3" runat="server">
                                </cc1:ValidatorCalloutExtender>
    </td>
    <td >Họ tên</td>
    <td><asp:TextBox ID="txtHoTenBA2" width="200px" BackColor="#ffff66" ReadOnly="true" runat="server"></asp:TextBox></td>
  </tr>
</table>

<div>
<span class="bt"><asp:Button ID="btCheck" runat="server" Text="Kiểm tra" 
        onclick="btCheck_Click" /></span>
<span class="bt"><asp:Button ID="btChonLai" runat="server" Text="Chọn lại" CausesValidation="false"
        onclick="btChonLai_Click" /></span>
<span class="bt"><asp:Button ID="btChuyenDoanhSo" runat="server" 
        Text="Chuyển doanh số" onclick="btChuyenDoanhSo_Click" /></span>
<span class="bt"><asp:Button ID="btXoaManHinh" runat="server" CausesValidation="false" Text="Xóa màn hình" 
        onclick="btXoaManHinh_Click" /></span>
</div>
   
</ContentTemplate>
</asp:UpdatePanel>